﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
/// Summary description for NhaCungCap
/// </summary>
public class ENhaCungCap
{
    private int maNhaCC;
    private string tenNhaCC;
    private string diaChi;
    private string dienThoai;
    public ENhaCungCap()
    { }
    public ENhaCungCap(int maNhaCC, string tenNhaCC, string diaChi, string dienThoai)
    {
        this.maNhaCC = maNhaCC;
        this.tenNhaCC = tenNhaCC;
        this.diaChi = diaChi;
        this.dienThoai = dienThoai;
    }
    public int MaNhaCC
    {
        get { return this.maNhaCC; }
        set
        {
            this.maNhaCC = value;
        }
    }
    public string TenNhaCC
    {
        get { return this.tenNhaCC; }
        set
        {
            if (value == null)
                throw new Exception("tenNhaCC not allow nullvalue.");
            this.tenNhaCC = value;
        }
    }
    public string DiaChi
    {
        get { return this.diaChi; }
        set { this.diaChi = value; }
    }
    public string DienThoai
    {
        get { return this.dienThoai; }
        set { this.dienThoai = value; }
    }
    public override string ToString()
    {
        return this.maNhaCC + "; " + this.tenNhaCC + "; " + this.diaChi + "; " + this.dienThoai + "; ";
    }
    public override bool Equals(Object obj)
    {
        ENhaCungCap me = (ENhaCungCap)obj;
        bool ret = this.MaNhaCC.Equals(me.MaNhaCC);
        return ret;
    }
    public override int GetHashCode()
    {
        return this.MaNhaCC.GetHashCode();
    }


}